<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">
<!--     <link rel="shortcut icon" href="../../assets/ico/favicon.png"> -->

    <title>Administraci&oacute;n de Condominio "ANSI"</title>

    <!-- Bootstrap core CSS -->
    <link href="css/bootstrap-3.0.2.css" rel="stylesheet" media="screen">

    <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
      <script src="../../assets/js/html5shiv.js"></script>
      <script src="../../assets/js/respond.min.js"></script>
    <![endif]-->
  </head>

  <body>
        
	  <!-- Static navbar -->
	  <div class="navbar navbar-default navbar-static-top">
	    <div class="container">
	      <div class="navbar-header">
	        <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
	          <span class="icon-bar"></span>
	          <span class="icon-bar"></span>
	          <span class="icon-bar"></span>
	        </button>
	        <a class="navbar-brand" href="#">Condominios "ANSI"</a>
	      </div>
	      <div class="navbar-collapse collapse">
	        <ul class="nav navbar-nav">
	          <li class="active"><a href="principal.jsp">Inicio</a></li>
	          <li class="dropdown">
	            <a href="#" class="dropdown-toggle" data-toggle="dropdown">Mantenimientos <b class="caret"></b></a>
	            <ul class="dropdown-menu">
	              <li><a href="RegistrarResidente.jsp">Residentes</a></li>
	              <li><a href="#">Viviendas</a></li>	 
	              <li><a href="visita.jsp">Visitas</a></li>          
	              <li><a href="juntas.jsp">Juntas</a></li>    
	              <li><a href="#">Reserva Espacio Comun</a></li>
	               <li><a href="#">Cuotas</a></li>
	            </ul>
	          </li>
	          <li><a href="#">Reportes</a></li>	          
	          <li><a href="LogoutServlet">Salir</a></li>
	        </ul>
	      </div><!--/.nav-collapse -->
	    </div>
	  </div>
      
	 <div class="container"> 
	   
	   <!-- Jumbotron -->
	   <div class="jumbotron">     
	   		<h4>Bienvenid@ <b>${sessionScope.USUARIO_ACTUAL.nombres } ${sessionScope.USUARIO_ACTUAL.paterno }</b></h4>	     
	   </div>
	   
	   <div class="row">
        
        <H4 align="center">REGISTRO DE JUNTAS</H4>
        
        
        <%@ page import="java.io.*,java.util.*,java.net.*,java.sql.*" %>

<%

// declarando y creando objetos globales

Connection canal = null;

ResultSet tabla= null;

Statement instruccion=null;

 String strcon = "jdbc:mysql://localhost/Condominio_ansi?user=root&password=root";

if(request.getParameter("OK") != null)

{

// abriendo canal o enlace en su propio try-catch

try {

	Class.forName("com.mysql.jdbc.Driver").newInstance();

canal=DriverManager.getConnection(strcon);

instruccion = canal.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,

ResultSet.CONCUR_UPDATABLE);

}
catch(java.lang.ClassNotFoundException e){} catch(SQLException e) {};

//leyendo tabla en disco y pasandola al resultset

try { tabla = instruccion.executeQuery("select idJunta, Fecha_Junta, Hora_Junta, Tema_Junta, Acuerdo_Junta, Residente_DNI_Responsable01, Residente_DNI_Responsable02 from junta");
//residente.Nombre_Residente

// mandando resultset a una tabla html

out.println("<TABLE Border=5 CellPadding=5 align=center><TR>");

out.println("<th>ID Junta</th><th>FECHA</th><th>HORA</th><th>TEMA</th><th>ACUERDO</th><th>RESPONSABLE01</th><th>RESPONSABLE02</th></TR>");

// ciclo de lectura del resultset

while(tabla.next()) {

out.println("<TR>");

out.println("<TD>"+tabla.getString(1)+"</TD>");

out.println("<TD>"+tabla.getString(2)+"</TD>");

out.println("<TD>"+tabla.getString(3)+"</TD>");

out.println("<TD>"+tabla.getString(4)+"</TD>");

out.println("<TD>"+tabla.getString(5)+"</TD>");

out.println("<TD>"+tabla.getString(6)+"</TD>");

out.println("<TD>"+tabla.getString(7)+"</TD>");

out.println("</TR>"); }; // fin while

out.println("</TABLE></CENTER></DIV></HTML>");

// cerrando resultset

tabla.close(); instruccion.close();canal.close();} //fin try no usar ; al final de dos o mas catchs

catch(SQLException e) {};

};

// construyendo forma dinamica

out.println("<FORM ACTION=juntas.jsp METHOD=post>");

out.println("<INPUT TYPE=submit name=OK value=Consulta Juntas><BR>");

out.println("</FORM>");

%>
       
        <table align="center">
        
        <tr>
        
        <td><input type="button" value="Nueva Junta" onclick="location='registrojuntas.jsp'" /></td>
        
        
        </tr>
        </table>
        </form>
                
	
	   <!-- Site footer -->
	   <div class="footer">
	   	 <p>&nbsp;</p>
	     <p> Grupo ANSI &copy 2014 </p>
	   </div>
	   
	 </div> <!-- /container -->
    
   


    <!-- Bootstrap core JavaScript
    ================================================== -->
    <!-- Placed at the end of the document so the pages load faster -->
    
     <!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
    <script src="js/jquery-1.10.2.js"></script>
    <!-- Include all compiled plugins (below), or include individual files as needed -->
    <script src="js/bootstrap.js"></script>
  </body>
</html>
